﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SavedCharacter : MonoBehaviour
{
    [SerializeField]
    private Text charInfo;
    [SerializeField]
    private Text datentime;
    [SerializeField]
    private Image portrait;
    [SerializeField]
    private GameObject hidable;
    [SerializeField]
    private int index;
    private void Awake()
    {
        //Debug.Log("sc awake");
        //HideInfo();
    }
    public int MyIndex { get => index; }
    public void DisplayInfo(SaveScript data)
    {
        hidable.SetActive(true);
        datentime.text = "Date: " + 
            data.MyDateTime.ToString("dd/MM/yyyy")+
            " - "+ 
            data.MyDateTime.ToString("HH:mm:ss");
        charInfo.text = data.MyPlayerData.MyName+", " + data.MyPlayerData.MyLevel.ToString();
        
    }
    public void HideInfo()
    {
        hidable.SetActive(false);
    }
}
